-- GENERATED SPELL FOR [Grand Admiral Westwind] --


function spell0_29621(pUnit, Event) --@Carrion Swarm,n/a--
pUnit:FullCastSpellOnTarget(60502,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29621', 10000, 1)
end

function spell1_29621(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29621', 617, 1)
end

function spell2_29621(pUnit, Event) --@Heroic Strike,n/a--
pUnit:FullCastSpellOnTarget(57846,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29621', 566, 1)
end

function spell3_29621(pUnit, Event) --@Mind Blast,n/a--
pUnit:FullCastSpellOnTarget(60500,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29621', 1500, 1)
end

function spell4_29621(pUnit, Event) --@Protection Sphere,Self--
pUnit:FullCastSpellOnTarget(50161,pUnit)
pUnit:RegisterEvent('Sorts_29621', 522, 1)
end

function spell5_29621(pUnit, Event) --@Sleep,n/a--
pUnit:FullCastSpellOnTarget(53045,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29621', 4323, 1)
end

function spell6_29621(pUnit, Event) --@Vampiric Touch,Self--
pUnit:FullCastSpellOnTarget(60501,pUnit)
pUnit:RegisterEvent('Sorts_29621', 30293, 1)
end

function spell7_29621(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15578,pUnit)
pUnit:RegisterEvent('Sorts_29621', 566, 1)
end

function spell8_29621(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(49807,pUnit)
pUnit:RegisterEvent('Sorts_29621', 2000, 1)
end

function Sorts_29621(pUnit, Event)
local choix_sorts_29621 = math.random(0, 8)
if choix_sorts_29621 == 0 then
pUnit:RegisterEvent('spell0_29621', 1, 1)
end
if choix_sorts_29621 == 1 then
pUnit:RegisterEvent('spell1_29621', 1, 1)
end
if choix_sorts_29621 == 2 then
pUnit:RegisterEvent('spell2_29621', 1, 1)
end
if choix_sorts_29621 == 3 then
pUnit:RegisterEvent('spell3_29621', 1, 1)
end
if choix_sorts_29621 == 4 then
pUnit:RegisterEvent('spell4_29621', 1, 1)
end
if choix_sorts_29621 == 5 then
pUnit:RegisterEvent('spell5_29621', 1, 1)
end
if choix_sorts_29621 == 6 then
pUnit:RegisterEvent('spell6_29621', 1, 1)
end
if choix_sorts_29621 == 7 then
pUnit:RegisterEvent('spell7_29621', 1, 1)
end
if choix_sorts_29621 == 8 then
pUnit:RegisterEvent('spell8_29621', 1, 1)
end
end

function mob29621_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_29621', math.random(1500, 3000), 1)
end

function mob29621_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29621_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29621_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(29621, 1, 'mob29621_Action')
RegisterUnitEvent(29621, 2, 'mob29621_Leave')
RegisterUnitEvent(29621, 3, 'mob29621_Kill')
RegisterUnitEvent(29621, 4, 'mob29621_Die')
